package com.zth.Controller;

import com.github.pagehelper.PageInfo;
import com.zth.entity.MyPage;
import com.zth.entity.TbUser;
import com.zth.service.TbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("tuser")
public class TbUserController {
    @Autowired
    private TbUserService tbUserService;

//    //查询所有
//    @GetMapping("queryAll")
//    @ResponseBody
//    public List<TbUser> getAll(){
//        return  tbUserService.findAll();
//    }

    //通用mapper
    @GetMapping("query1")
    @ResponseBody
    public  List<TbUser> findAll1(){

        return tbUserService.findAll();
    }


    @GetMapping("query")
    @ResponseBody
    public PageInfo queryByPage(MyPage page){
        return tbUserService.queryByPage(page);
    }
}
